﻿namespace Community.CsharpSqlite.Entity
{
    /*
    ** A complete page cache is an instance of this structure.
    */

    public class PCache
    {
        public bool bPurgeable; /* True if pages are on backing store */
        public int nMax; /* Configured cache size */
        public int nRef; /* Number of referenced pages */
        public PCache1 pCache; /* Pluggable cache module */
        public PgHdr pDirty, pDirtyTail; /* List of dirty pages in LRU order */
        public PgHdr pPage1; /* Reference to page 1 */
        public object pStress; /* Argument to xStress */
        public PgHdr pSynced; /* Last synced page in dirty page list */
        public int szExtra; /* Size of extra space for each page */
        public int szPage; /* Size of every page in this cache */
        public dxStress xStress; //int (*xStress)(void*,PgHdr*);       /* Call to try make a page clean */

        public void Clear()
        {
            pDirty = null;
            pDirtyTail = null;
            pSynced = null;
            nRef = 0;
        }
    };
}